import './js/libs/weapp-adapter'
import './js/libs/symbol'
import { renderQueue, triggerPageState, step0, step1, mainContext } from './js/runtime/reducer'

// import Main from './js/main'

// new Main()

const animate = () => {
  if (renderQueue.length > 0) {
    mainContext.clearRect(0, 0, wx.getSystemInfoSync().windowWidth, wx.getSystemInfoSync().windowHeight);

    renderQueue.map((component, index) => {
      component.drawToMainCanvas();
    });
  }
  
  requestAnimationFrame(animate);
}

wx.onTouchStart(function (e) {
  triggerPageState(step1)
})

triggerPageState(step0)
animate();